feat: Implement WebSocket chat functionality with message handling and storage#7
Merged
feat: Implement WebSocket chat functionality with message handling and storage#7
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces real-time event chat via Spring WebSocket/STOMP, including message broadcasting and persistence of chat messages per event.
Changes:
- Added WebSocket/STOMP broker configuration and a chat messaging endpoint.
- Implemented chat message handling (controller/service) and JDBC persistence (repository).
- Added request/response DTOs for chat message payloads.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/dev/pasinduog/eventsphere/config/WebSocketConfig.java | Configures STOMP endpoint and broker prefixes for event chat. |
| src/main/java/dev/pasinduog/eventsphere/controller/ChatController.java | Handles inbound chat messages per event and broadcasts responses. |
| src/main/java/dev/pasinduog/eventsphere/dto/ChatMessageRequest.java | Defines inbound chat message payload structure. |
| src/main/java/dev/pasinduog/eventsphere/dto/ChatMessageResponse.java | Defines outbound/broadcast chat message payload structure. |
| src/main/java/dev/pasinduog/eventsphere/repository/ChatMessageRepository.java | Declares persistence operation for chat messages. |
| src/main/java/dev/pasinduog/eventsphere/repository/impl/ChatMessageRepositoryImpl.java | Persists chat messages to chat_messages via JdbcTemplate. |
| src/main/java/dev/pasinduog/eventsphere/service/ChatMessageService.java | Declares business operation for saving messages. |
| src/main/java/dev/pasinduog/eventsphere/service/impl/ChatMessageServiceImpl.java | Implements message persistence via repository and returns stored response. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
PasinduOG
commented
Apr 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a real-time chat feature for events using WebSockets and STOMP messaging in the application. The main changes include the full setup for WebSocket communication, message handling, and persistence of chat messages related to specific events.
WebSocket and Messaging Infrastructure:
WebSocketConfigto enable and configure WebSocket message broker with STOMP endpoints for event chat (/ws-event-chatendpoint,/appprefix for application destinations,/topicfor broadcasting messages).Chat Messaging Functionality:
ChatControllerto handle incoming chat messages for specific events and broadcast them to subscribers using STOMP.ChatMessageRequestandChatMessageResponseDTOs for structured chat message data transfer. [1] [2]Persistence Layer:
ChatMessageRepositoryinterface and its implementationChatMessageRepositoryImplto save incoming chat messages to the database usingJdbcTemplate. [1] [2]Service Layer:
ChatMessageServiceinterface and its implementationChatMessageServiceImplto handle business logic for saving chat messages. [1] [2]